﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'up_UtilityAssetXMissionStructuresPoles_QuickSearch')
	DROP PROCEDURE up_UtilityAssetXMissionStructuresPoles_QuickSearch
GO


CREATE PROCEDURE [dbo].[up_UtilityAssetXMissionStructuresPoles_QuickSearch]
	 @UtilityFk int = -1
	,@Utility_Asset_XMissionStructures_PoleId int = -1
AS

SELECT 
	 --CAST(Utility_Asset_XMissionStructures_PoleId as varchar)
	CAST(Utility_Asset_XMissionStructureId as varchar)
FROM 
	tb_Utility_Asset_XMissionStructures_Poles Pole
INNER JOIN tb_Utility_Asset_XMissionStructures Structure
	ON Structure.Utility_Asset_XMissionStructureId = Pole.Utility_Asset_XMissionStructureFK
WHERE 
	Structure.UtilityFK = @UtilityFk
	AND Utility_Asset_XMissionStructures_PoleId = @Utility_Asset_XMissionStructures_PoleId


 